#ifndef __KEY_H_
#define __KEY_H_

#include "sys.h"
#include "stdbool.h"

#define KEY_PORT GPIOB
#define KEY_PORT_RCC RCC_APB2Periph_GPIOB
#define KEY1_PIN GPIO_Pin_12
#define KEY2_PIN GPIO_Pin_13
#define KEY3_PIN GPIO_Pin_14
#define KEY4_PIN GPIO_Pin_15


struct keys
{
	unsigned char keyFlag;
	unsigned int keyTime;
	bool keyState;
	bool keyShortDown;
	bool keyLongDown;
};

extern struct keys key[4];

void Key_Init(void);
void keyScan(void);

#endif
